import type { CanvasComponent } from '../stores/designStore';
import { exportHtml, exportMiniblinkProject } from './htmlExporter';

export type ExportType = 'html' | 'miniblink';

interface ExportOptions {
  type: ExportType;
  outputDir: string;
  productName: string;
  components: CanvasComponent[];
  elementPlusStyles?: string;
  elementPlusRuntime?: string;
  vueRuntime?: string;
  globalStyles?: string;
  componentStyles?: string;
}

/**
 * 导出管理器
 * @param options 导出选项
 * @returns Promise<void>
 */
export async function exportProject(options: ExportOptions): Promise<void> {
  const { type, ...exportOptions } = options;

  switch (type) {
    case 'html':
      await exportHtml(exportOptions);
      break;
    case 'miniblink':
      await exportMiniblinkProject(exportOptions);
      break;
    default:
      throw new Error(`不支持的导出类型: ${type}`);
  }
} 